<?php
namespace Forms\Filter;

use Pinenut\Form\Filter;

class EmptyToNullAction extends Filter
{
	public function run()
	{

		if (is_array($this->request->value)) {
			if ((1 == count($this->request->value) && empty($this->request->value[0]))) {
				return null;
			}
		}

		return $this->request->value;
	}
}